﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XSTDZ.ERP.Core.Generator;

namespace XSTDZ.ERP.Domain.Models
{
    /// <summary>
    /// 库存
    /// </summary>
    public partial class Stock
    {
        public Stock()
        {
            this.ReturnBillDetail = new HashSet<ReturnBillDetail>();
            this.ProductCheckBillDetail = new HashSet<ProductCheckBillDetail>();
            this.ProductDeliveryBillDetail = new HashSet<ProductDeliveryBillDetail>();
            this.ProductReturnBillDetail = new HashSet<ProductReturnBillDetail>();
            this.ProductSellBillDetail = new HashSet<ProductSellBillDetail>();
            this.ProfitAndLossBillDetail = new HashSet<ProfitAndLossBillDetail>();
        }
        public Stock InitStock(Stock stock)
        {
            if (stock.Id.Equals(Guid.Empty))
            {
                this.Id = (Guid)new SequentialIdentityGenerator().Next;
            }
            return this;
        }
        public Stock AddStockCount(Stock stock)
        {

            this.StockCount =this.StockCount+ stock.StockCount;

            return this;
        }
    }
}
